package util.translate;

import java.io.IOException;
import java.util.List;

import org.jdom.Document;
import org.jdom.Element;
import org.jdom.JDOMException;
import org.jdom.input.SAXBuilder;

public class Test {

	/**
	 * @param args
	 */
	public static void main(String[] args) {
		
		SAXBuilder builder = new SAXBuilder(false);
		Document doc = null;
		String s = null;
		try {
			doc = builder.build("test.xml");
			Element books = doc.getRootElement();
			s = books.getTextTrim();
		} catch (JDOMException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		} catch (IOException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
		
		long t1 = System.currentTimeMillis();
		GoogleTranslate gst = new GoogleTranslate();
		System.out.println(gst.getTString(s));
		long t2 = System.currentTimeMillis();
		System.out.println(t2-t1);
		
		long t3 = System.currentTimeMillis();
		Translator translator = new Translator();
		System.out.println(translator.getTString(s));
		long t4 = System.currentTimeMillis();
		System.out.println(t4-t3);
	}

}
